package crmsystem.com.service.impl;

import crmsystem.com.utils.Query;
import crmsystem.com.utils.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import crmsystem.com.dao.ProductInformationDao;
import crmsystem.com.entity.ProductInformationEntity;
import crmsystem.com.service.ProductInformationService;


@Service("productInformationService")
public class ProductInformationServiceImpl extends ServiceImpl<ProductInformationDao, ProductInformationEntity> implements ProductInformationService {

    @Autowired
    ProductInformationDao productInformationDao;
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ProductInformationEntity> page = this.page(
                new Query<ProductInformationEntity>().getPage(params),
                new QueryWrapper<ProductInformationEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<ProductInformationEntity> getByIndex(String index) {
        return productInformationDao.selectByIndex(index);
    }

}